package ar.edu.utn.frsf.proyectofinal.sistemadecontrolmodbus.presentation.controller.admin;

import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;

import ar.edu.utn.frsf.proyectofinal.sistemadecontrolmodbus.service.SystemService;

@ManagedBean(name="sysOffOn")
@ApplicationScoped
public class SysOffOnBean {
	
	@ManagedProperty(value="#{systemService}")
	private SystemService sysService;
	
	public void setOn(){
        System.out.println("System set on");
        sysService.activate();
	}
	public void setOff(){
        System.out.println("System set off"); 
        sysService.deactivate();
	}
	
	public SystemService getSysService() {
		return sysService;
	}
	
	public void setSysService(SystemService sysService) {
		this.sysService = sysService;
	}
	
	public boolean isActive(){
		return this.sysService.isActive();
	}
}
